package com.bicon.botu.medical.common.enums

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonValue

/**
 * @version 1.0.0
 * @author: Gyb
 * @date 2018/7/17
 * @description 食物分类枚举
 **/
enum class FoodCategory(@JsonValue val value: String) {
    SYSTEM("system"),
    CUSTOM("custom");

    companion object {
        @JsonCreator
        @JvmStatic
        fun enumOf(value: String): FoodCategory {
            val found = FoodCategory.values().find { value == it.value }
            if (found != null) {
                return found
            } else {
                throw IllegalArgumentException("not found ConversationCategory with $value")
            }
        }
    }

}